Smart Tracking Api
1. SUBSCRIPTION API
To handle application registration and unregistration process.
1.1. Registration Service
- DESCRIPTION : To register new application
- URL: https://ideabiz.lk/apicall/dapsubscription/v1.0/registration
- METHOD: POST Request Header
- DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationName Application unique name string required callbackUrl Callback url for alert generation string required - SUCCESS RESPONSE:
Status Code S101 StatusDetail App registration success responseData - appId
- appName
- status
- REGISTERED/UNREGISTERED
- callbackUrl
- createdDate
- ERROR RESPONSE:
Error code Error message E101 <parameter> not found or empty in the request -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationName":"app", "callbackUrl":"sgtv" }
-
SAMPLE RESPONSE :
{ "statusCode":"S101", "statusDetail":"Application successfully registered", "responseData": { "appId": "kv9ygf9p", "appName": "app", "status": "REGISTERED", "callbackUrl": "128.217.137.199/callback", "createdDate": "2017-06-30", } }
Content-Type: application/json
Authorization: Bearer [access token]
Accept: application/json
1.2. Application Update Service
- DESCRIPTION : To update an application
- URL: https://ideabiz.lk/apicall/dapsubscription/v1.0/update
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required applicationName Application unique name string optional callbackUrl Callback url for alert generation string optional - SUCCESS RESPONSE:
Status Code S102 StatusDetail Application update success responseData - appId
- appName
- status
- REGISTERED/UNREGISTERED
- callbackUrl
- createdDate
- ERROR RESPONSE:
Error code Error message E102 applicationId not found or empty in the request E103 Application for application id : <applicationId> not found E104 Application for application id : <applicationId> already unregistered E108 applicationName and callbackUrl both not found in the request
-
SAMPLE HEADER
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"kv9ygf9p", "applicationName":"app", "callbackUrl":"128.217.137.199/callback" }
-
SAMPLE RESPONSE :
{ "statusCode":"S102", "statusDetail":"Application update success", "responseData": { "appId": "kv9ygf9p", "appName": "app", "status": "REGISTERED", "callbackUrl": "128.217.137.199/callback", "createdDate": "2017-06-30", } }
1.3. Un-registration Service
- DESCRIPTION : To unregister registered application. All routes and vehicles will be disabled after unregistration
- URL:https://ideabiz.lk/apicall/dapsubscription/v1.0/unregistration
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required - SUCCESS RESPONSE:
Status Code S110 StatusDetail Application successfully unregistered responseData - appId
- appName
- status
- REGISTERED/UNREGISTERED
- callbackUrl
- createdDate
- ERROR RESPONSE:
Error code Error message E103 Application for application id : <applicationId> not found E104 Application for application id : <applicationId> already unregistered E105 Application for application id : <applicationId> have started schedules E110 Application Id not found or empty in the request -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"kv9ygf9p" }
-
SAMPLE RESPONSE :
{ "statusCode":"S110", "statusDetail":"Application successfully unregistered", "responseData": { "appId": "kv9ygf9p", "appName": "app", "status": "UNREGISTERED", "callbackUrl": "128.217.137.199/callback", "createdDate": "2017-06-30", } }
2. VEHICLE API
To handle vehicle registration and vehicle location.
2.1. Vehicle Create Service
- DESCRIPTION : To add a new vehicle to application
- URL:https://ideabiz.lk/apicall/dapvehicle/v1.0/create
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required vehicleName Unique name for the vehicle within application string required - SUCCESS RESPONSE:
Status Code S201 StatusDetail Vehicle create success responseData - appId
- vehicleId
- System generted unique id for the vehicle
- vehicleName
- createdDate
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E201 Application id or vehicle name not found or empty in the request E202 Vehicle name : <vehicleName> should be less than 10 characters
-
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "vehicleName":"v1" }
-
SAMPLE RESPONSE :
{ "statusCode":"S201", "statusDetail":"Vehicle create success", "responseData": { "appId": "zfpqb6e9", "vehicleId": "hq37tjsq", "vehicleName": "v1", "createdDate": "2017-06-30", } }
2.2. Vehicle Location Service
- DESCRIPTION : To update vehicle latest location
- URL:https://ideabiz.lk/apicall/dapvehicle/v1.0/update_location
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required vehicleId Vehicle unique id string required lat Latitude float required lng Longitude float required datetime Date time string (Y-m-d H:i:s) String required - SUCCESS RESPONSE:
Status Code S210 StatusDetail New location added successfully responseData - 0 => routeId
- 1 => pointId
- 2 => distance from beginning
- 3 => time from beginning
- 4 => avg speed
- 5 => lat
- 6 => lng
- 7=>invalid lat
- 8=>invalid lng
- 9=>time from beginning to invalid point
- 10=>total average speed
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E210 <parameter> not found or empty in the request E211 Error in date time format : < timeString > E212 No running schedule is configured for the vehicle : < vehicleId > E260 No vehicle found for application id : <applicationId> vehicle id : <vehicleId> E312 Error in format lat : <lat> lng : <lng> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "vehicleId":"hq37tjsq", "lat":"7.783495", "lng":"80.87294", "datetime":"2017-01-01 12:12:12" }
-
SAMPLE RESPONSE :
{ "statusCode":"E212", "statusDetail":"No running schedule is configured for the vehicle : hq37tjsq", "responseData": [] }
2.3. Vehicle Rename Service
- DESCRIPTION : To change vehicle name
- URL:https://ideabiz.lk/apicall/dapvehicle/v1.0/rename
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required vehicleId Vehicle unique id string required VehicleName New vehicle name to update string required - SUCCESS RESPONSE:
Status Code S220 StatusDetail Vehicle rename success responseData - appId
- vehicleId
- vehicleName
- createdDate
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E220 <parameter> not found or empty in the request E260 No vehicle found for application id : <applicationId> vehicle id : <vehicleId> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "vehicleId":"wix4k35g", "vehicleName":"v10" }
-
SAMPLE RESPONSE :
{ "statusCode":"S220", "statusDetail":"Vehicle rename success", "responseData": { "appId": "zfpqb6e9", "vehicleId": "wix4k35g", "vehicleName": "v10", "createdDate": "2017-07-02" } }
2.4. Vehicle View Service
- DESCRIPTION : To view vehicle status
- URL:https://ideabiz.lk/apicall/dapvehicle/v1.0/get
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required vehicleId Vehicle unique id string required - SUCCESS RESPONSE:
Status Code S230 StatusDetail Vehicle get success responseData - appId
- vehicleId
- vehicleName
- createdDate
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E230 <parameter> not found or empty in the request E260 No vehicle found for application id : <applicationId> vehicle id : <vehicleId> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "vehicleId":"wix4k35g" }
-
SAMPLE RESPONSE :
{ "statusCode":"S230", "statusDetail":"Vehicle get success", "responseData": { "appId": "zfpqb6e9", "vehicleId": "wix4k35g", "vehicleName": "v10", "createdDate": "2017-07-02" } }
2.5. Vehicle Remove Service
- DESCRIPTION : To remove a vehicle
- URL:https://ideabiz.lk/apicall/dapvehicle/v1.0/remove
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required vehicleId Vehicle unique id string required - SUCCESS RESPONSE:
Status Code S240 StatusDetail Vehicle remove success responseData - appId
- vehicleId
- vehicleName
- createdDate
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E240 <parameter> not found or empty in the request E250 There are pending or running schedules for the vehicleId : <vehicleId> E260 No vehicle found for application id : <applicationId> vehicle id : <vehicleId> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "vehicleId":"wix4k35g" }
-
SAMPLE RESPONSE :
{ "statusCode":"S240", "statusDetail":"Vehicle remove success", "responseData": { "appId": "zfpqb6e9", "vehicleId": "wix4k35g", "vehicleName": "v10", "createdDate": "2017-07-02" } }
3.ROUTE API
To handle vehicle registration and vehicle location.
3.1. Route Create Service
- DESCRIPTION : To create and maintain routes (including adding pickup points )
- URL:https://ideabiz.lk/apicall/dapvehicle/v1.0/create
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required routeName Unique name for the route string required jsonPath Path point array in json format String '[[lat,lng],[lat,lng],..]’ required - SUCCESS RESPONSE:
Status Code S301 StatusDetail Route create success responseData - rote
- appId
- routeId
- routeName
- createdPath
- resampledPath
- [[lat,lng],[lat,lng],...]
- rote
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E301 <parameter> not found or empty in the request E302 Error in jsonPath format : <jsonPath string> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "routeName":"r1", "jsonPath":"[[7.100812, 79.914290],[7.100280, 79.914185],[7.099752, 79.914105],[7.098979, 79.914212]]" }
-
SAMPLE RESPONSE :
{ "statusCode":"S301", "statusDetail":"Route created success", "responseData": { "route": { "appId":"zfpqb6e9", "routeId":"qqdkmyfd", "routeName":"r1", "createdDate":"2017-06-30" }, "resampledPath":[[7.100812,79.91429],[7.1007679216833,79.914281300323],[7.0990811646065,79.91419940325],[7.0990365813163,79.914204900307],...] } }
3.2. Route Get Service
- DESCRIPTION : to get route details for a given application id and route
- URL:https://ideabiz.lk/apicall/daproute/v1.0/get
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required routeId Route unique id string required - SUCCESS RESPONSE:
Status Code S330 StatusDetail Route get success responseData - appId
- routeId
- routeName
- createdDate
- points
- pickupPoints
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E315 No route found for application id : <applicationId> and route id : <routeId> E330 <parameter> not found or empty in the request -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "routeId":"qqdkmyfd" }
-
SAMPLE RESPONSE :
{ "statusCode":"S330", "statusDetail":"Route get success", "responseData": { "appId":"zfpqb6e9", "routeId":"qqdkmyfd", "routeName":"r1", "createdDate":"2017-06-30", "points": [ { "name": 1, "lat": 7.100812, "lng": 79.91429, "dis": 0, "dist": 0 }, { "name": 2, "lat": 7.1007679216833, "lng": 79.914281300323, "dis": 4.9369, "dist": 4.9369 }, .... { "name": 41, "lat": 7.0990811646065, "lng": 79.91419940325, "dis": 5.1091, "dist": 194.9848 } ], "pickupPoints": [ { "p_name": 30, "pu_id": "30ciw", "lat": 7.0995269975049, "lng": 79.914144432624, "dis": 5.1091, "Dist": 145.0134 } ] } }
3.3. Route Update Service
- DESCRIPTION : to get route details for a given application id and route
- URL:https://ideabiz.lk/apicall/daproute/v1.0/update
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required routeId Route unique id string required routeName Unique name for the route string required jsonPath Path point array in json format String '[[lat,lng],[lat,lng],..]' required - SUCCESS RESPONSE:
Status Code S360 StatusDetail Route update success responseData - route
- appId
- routeId
- routeName
- createdDate
- resampledPath
- [[lat,lng],[lat,lng],...]
- route
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E315 No route found for application id : <applicationId> and route id : <routeId> E360 <parameter> not found or empty in the request E361 Error in json path format <jsonPath> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "routeName":"r1", "jsonPath":"[[7.100812, 79.914290],[7.100280, 79.914185],[7.099752, 79.914105],[7.098979, 79.914212]]" }
-
SAMPLE RESPONSE :
{ "statusCode":"S360", "statusDetail":"Route update success", "responseData": { "route":{ "appId":"zfpqb6e9", "routeId":"qqdkmyfd", "routeName":"r1", "createdDate":"2017-06-30", }, "resampledPath":[[7.100812,79.91429],[7.1007679216833,79.914281300323],[7.0990811646065,79.91419940325],[7.0990365813163,79.914204900307],...] }
3.4. Add Pickup Point Service
- DESCRIPTION : Add and manage pickup points for a given route
- URL:https://ideabiz.lk/apicall/daproute/v1.0/pickup_point/add
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required routeId Route unique id string required pickupPointName Unique name for the pickup point string required lat Pick up point latitude float required lng Pick up point longitude float required
- SUCCESS RESPONSE:
Status Code S310 StatusDetail Add new pickup point success responseData - p_name
- estimated point name
- pu_id
- system generated point id
- lat
- lng
- lng
- distance from the previous point
- dist
- total distance from the beginning
- p_name
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E310 <parameter> not found or empty in the request E311 No approximation point found for lat : <lat> lng : <lng> E312 Error in format lat : <lat> lng : <lng> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "pickupPointName":"pickup1", "routeId":"qqdkmyfd", "lat":"7.099525", "lng":"79.914151"
-
SAMPLE RESPONSE :
{ "statusCode":"S310", "statusDetail":"Add new pickup point success", "responseData": { "p_name":30, "pu_id":"30ciw", "lat":7.0995269975049, "lng":79.914144432624, "dis":5.1091, "dist":145.0134 }
3.5. Remove Pickup Point Service
- DESCRIPTION : remove pickup point in a given route
- URL:https://ideabiz.lk/apicall/daproute/v1.0/pickup_point/remove
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required routeId Route unique id string required pickupPointId Pickup point unique id string required
- SUCCESS RESPONSE:
Status Code S340 StatusDetail Remove pickup point success responseData - routeId
- pointId
- latitude
- longitude
- distance_from_previous_node
- distance_from_the_beginning
- pickup_point_id
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E315 No route found for application id : <applicationId> route id : <routeId> E340 <parameter> not found or empty in the request E312 No pickup point found for application id : <applicationId> routeId : <routeId> pickup point id : <pickupPointId> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "routeId":"qqdkmyfd", "pickupPointId":"40hfv"
-
SAMPLE RESPONSE :
{ "statusCode":"S340", "statusDetail":"Remove pickup point success", "responseData": { "routeId":"qqdkmyfd", "pointId":40, "latitude":7.0990811646065, "longitude":79.91419940325, "distance_from_previous_node":5.1091, "distance_from_the_beginning":194.9848, "pickup_point_id":"40hfv" }
3.6. Route Remove Service
- DESCRIPTION : to get route details for a given application id and route
- URL:https://ideabiz.lk/apicall/daproute/v1.0/remove
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required routeId Route unique id string required
- SUCCESS RESPONSE:
Status Code S350 StatusDetail Route remove success. responseData - appId
- routeId
- routeName
- createdDate
- points
- pickupPoints
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E315 No route found for application id : <applicationId> route id : <routeId> E350 <parameter> not found in the request E370 Route for routeId : <routeId> already removed -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "routeId":"qqdkmyfd" }
-
SAMPLE RESPONSE :
{ "statusCode":"S350", "statusDetail":"Route remove success", "responseData": { "appId":"zfpqb6e9", "routeId":"qqdkmyfd", "routeName":"r1", "createdDate":"2017-06-30", "points": [ { "name": 1, "lat": 7.100812, "lng": 79.91429, "dis": 0, "dist": 0 }, { "name": 2, "lat": 7.1007679216833, "lng": 79.914281300323, "dis": 4.9369, "dist": 4.9369 }, .... { "name": 41, "lat": 7.0990811646065, "lng": 79.91419940325, "dis": 5.1091, "dist": 194.9848 } ], "pickupPoints": [ { "p_name": 30, "pu_id": "30ciw", "lat": 7.0995269975049, "lng": 79.914144432624, "dis": 5.1091, "Dist": 145.0134 } ] } }
4. SCHEDULE API
To create and manage schedules
4.1.Schedule Create Service
- DESCRIPTION : Create new schedule
- URL:https://ideabiz.lk/apicall/dapschedule/v1.0/create
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required routeId Route unique id string optional
vehicleId Vehicle unique id string required date Schedule date. Format Y-m-d string required alertTypes Alert type details - CONVERGENCE_TIME
- CONVERGENCE_DISTANCE_LOS
- CONVERGEN7CE_DISTANCE_PATH
- DIVERGENCE_PATH
- DIVERGENCE_POINT
- DIVERGENCE_REGION
string required - SUCCESS RESPONSE:
Status Code S401 StatusDetail Schedule create success responseData - appId
- routeId
- vehicleId
- scheduleId
- startTime
- endTime
- status
- 1 => PENDING
- 2 => STARTED
- 3 => ENDED
- alertTypes
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E260 No vehicle found for application id : <applicationId> vehicle id : <vehicleId> E315 No route found for application id : <applicationId> route id : <routeId> E401 <parameter> not found or empty in the request E402 Error in date format : < date string > E403 Alert type : <alert type> not valid without routeId E404 <valueName> value is not found for alert type : <alertType> E405 <valueName> value is not <dataType> for the alert type : <alertType> E406 Alert type does not match -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "vehicleId":"hq37tjsq", "routeId":"qqdkmyfd", "date":"2017-07-26" "alertTypes": [ { "type" :"CONVERGENCE_TIME", "time" : 5 }, { “type”:”CONVERGENCE_DISTANCE”, “distance”:500 } ] }
-
SAMPLE RESPONSE :
{ "statusCode":"S401", "statusDetail":"Schedule create success", "responseData": { "appId":"zfpqb6e9", "routeId":"qqdkmyfd", "vehicleId":"hq37tjsq", "scheduleId":"uugxl9kj", "scheduleDate":"2017-07-26", "startTime": null, "endTime":null, "status":1, "alertTypes": [ { "type" :"CONVERGENCE_TIME", "time" : 5 }, { “type”:”CONVERGENCE_DISTANCE”, “distance”:500 } ] } }
4.2. Schedule Update Service
- DESCRIPTION : update a schedule
- URL:https://ideabiz.lk/apicall/dapschedule/v1.0/create/update
- METHOD: POST
- Headers :
Key Value accept authorization Content-Type application/json Bearer [access token] application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required scheduleId Schedule unique id string required alertTypes Alert type details - CONVERGENCE_TIME
- CONVERGENCE_DISTANCE_LOS
- CONVERGEN7CE_DISTANCE_PATH
- DIVERGENCE_PATH
- DIVERGENCE_POINT
- DIVERGENCE_REGION
string required - SUCCESS RESPONSE:
Status Code S407 StatusDetail Schedule update success responseData - appId
- routeId
- vehicleId
- scheduleId
- scheduleDate
- startTime
- endTime
- status
- 1 => PENDING
- 2 => STARTED
- 3 => ENDED
- alertTypes
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E403 Alert type : <alert type> not valid without routeId E404 <valueName> value is not found for alert type : <alertType> E405 <valueName> value is not <dataType> for the alert type : <alertType> E406 Alert type does not match E407 <parameter> not found or empty in the request E415 No Schedule found for application id : <applicationId> schedule id : <scheduleId> > E420 The schedule found for scheduleId : <scheduleId> is started or ended -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "vehicleId":"hq37tjsq" "alertTypes": [ { "type" :"CONVERGENCE_TIME", "time" : 5 }, { “type”:”CONVERGENCE_DISTANCE”, “distance”:500 } ] }
-
SAMPLE RESPONSE :
{ "statusCode":"S407", "statusDetail":"Schedule create success", "responseData": { "appId":"zfpqb6e9", "routeId":"qqdkmyfd", "vehicleId":"hq37tjsq", "scheduleId":"uugxl9kj", "scheduleDate":"2017-07-26", "startTime": null, "endTime":null, "status":1, "alertTypes": [ { "type" :"CONVERGENCE_TIME", "time" : 5 }, { “type”:”CONVERGENCE_DISTANCE”, “distance”:500 } ] } }
4.3. Schedule Start Service
- DESCRIPTION : Start schedule
- URL:https://ideabiz.lk/apicall/dapschedule/v1.0/create/start
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required scheduleId Schedule unique id string required - SUCCESS RESPONSE:
Status Code S410 StatusDetail Schedule start success responseData - appId
- routeId
- vehicleId
- scheduleId
- scheduleDate
- startTime
- endTime
- status
- 1 => PENDING
- 2 => STARTED
- 3 => ENDED
- akertTypes
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E410 <parameter> not found or empty in the request E411 Schedule : $ltscheduleId$gt is already started E412 Schedule : $ltscheduleId$gt is already ended E415 No schedule found for application id : $ltapplicationId> scheduleId : <scheduleId> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "scheduleId":"uugxl9kj" }
-
SAMPLE RESPONSE :
{ "statusCode":"S410", "statusDetail":"Schedule start success", "responseData": { "appId":"zfpqb6e9", "routeId":"qqdkmyfd", "vehicleId":"hq37tjsq", "scheduleId":"uugxl9kj", "scheduleDate":"2017-07-26", "startTime":"2017-06-26 09:40:14", "endTime":null, "status":2, "alertTypes": [ { "type" :"CONVERGENCE_TIME", "time" : 5 }, { “type”:”CONVERGENCE_DISTANCE”, “distance”:500 } ] } }
4.4. Schedule End Service
- DESCRIPTION : To end a schedule
- URL:https://ideabiz.lk/apicall/dapschedule/v1.0/create/end
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required scheduleId Schedule unique id string required - SUCCESS RESPONSE:
Status Code S420 StatusDetail Schedule end success responseData - appId
- routeId
- vehicleId
- scheduleId
- scheduleDate
- startTime
- endTime
- status
- 1 => PENDING
- 2 => STARTED
- 3 => ENDED
- alertTypes
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E411 Schedule : $ltscheduleId$gt is already started E415 No schedule found for application id : $ltapplicationId> scheduleId : <scheduleId> E420 <parameter> not found or empty in the request E480 Schedule : $ltscheduleId$gt is already ended -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"ilul8s00", "scheduleId":"uuycw1ua" }
-
SAMPLE RESPONSE :
{ "statusCode":"S420", "statusDetail":"Schedule end success", "responseData": { "appId":"ilul8s00", "routeId":"blrzqdmw", "vehicleId":"6pm5wieh", "scheduleId":"uuycw1ua", "scheduleDate":"2017-06-26", "startTime":"2017-06-26 09:40:14", "endTime":"2017-06-26 11:48:33", "status":3, "alertTypes": [ { "type" :"CONVERGENCE_TIME", "time" : 5 }, { “type”:”CONVERGENCE_DISTANCE”, “distance”:500 } ] } }
4.5. Schedule Status Service
- DESCRIPTION : To end a schedule
- URL:https://ideabiz.lk/apicall/dapschedule/v1.0/create/get
- METHOD: POST
- Headers :
Key Value accept authorization Content-Type application/json Bearer [access token] application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required date Schedule date . Format Y-m-d string required routeId Unique route id string optional vehicleId Unique vehicle id string optional scheduleId unique schedule id string optional - SUCCESS RESPONSE:
Status Code S430 StatusDetail Schedule get success responseData - appId
- routeId
- vehicleId
- scheduleId
- scheduleDate
- startTime
- endTime
- status
- 1 => PENDING
- 2 => STARTED
- 3 => ENDED
- alertTypes
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E260 No vehicle found for application id : <applicationId> vehicle id : <vehicle Id> E315 No route found for application id : <applicationId> route id : <routeId> E415 No schedule found for application id : $ltapplicationId> scheduleId : <scheduleId> E430 <parameter> not found or empty in the request -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"ilul8s00", "date":"2017-07-26", "vehicleId":"6pm5wieh", "routeId":"blrzqdmw", "scheduleId":"uuycw1ua" }
-
SAMPLE RESPONSE :
{ "statusCode":"S430", "statusDetail":"Schedule end success", "responseData": { "appId":"ilul8s00", "routeId":"blrzqdmw", "vehicleId":"6pm5wieh", "scheduleId":"uuycw1ua", "scheduleDate":"2017-06-26", "startTime":"2017-06-26 09:40:14", "endTime":"2017-06-26 11:48:33", "status":3, "alertTypes": [ { "type" :"CONVERGENCE_TIME", "time" : 5 }, { “type”:”CONVERGENCE_DISTANCE”, “distance”:500 } ] } }
5. GEOFENCE API
To create and manage circular, path and polygon geofences.
5.1. Circular Geofence Create Service
- DESCRIPTION : To create circular geofences
- URL:https://ideabiz.lk/apicall/dapgeofence/v1.0/circular/create
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required geofenceName Name to identify the geofence string required lat latitude float required lng longitude float required radius Radius of the circular geofence float required - SUCCESS RESPONSE:
Status Code S501 StatusDetail Circular geofence create success responseData - applicationId
- geofenceId
- geofenceName
- radius
- lat
- lng
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E312 Error in format lat : < lat > lng : < lng > E501 <parameter> not found or empty in the request E1001 Error in format : Radius is not a float number < value > -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "geofenceName":"cgf1", "lat":7.099081164, "lng":79.9141994, "Radius":"23.345" }
-
SAMPLE RESPONSE :
{ "statusCode":"S501", "statusDetail":"Add Circular Geofence Success", "responseData": { "applicationId":"zfpqb6e9", "geofenceId":"0ynnznwh", "geofenceName":"cgf1", "radius":23.345, "lat":7.099081164, "lng":79.9141994 } }
5.2. Circular Geofence Edit Service
- DESCRIPTION : To update circular geofences
- URL:https://ideabiz.lk/apicall/dapgeofence/v1.0/circular/edit
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required geofenceId Unique id for the circular geofence string required lat latitude float required lng longitude float required radius Radius of the circular geofence float required - SUCCESS RESPONSE:
Status Code S502 StatusDetail Circular geofence edit success responseData - applicationId
- geofenceId
- geofenceName
- radius
- lat
- lng
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E312 Error in format lat : < lat > lng : < lng > E502 <parameter> not found or empty in the request E540 No circular geofence found for application id : <applicationId> geofence id : <geofenceId> E1001 Error in format : Radius is not a float number < value > -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "geofenceId":"0ynnznwh", "lat":7.099081164, "lng":79.9141994, "Radius":"23.345" }
-
SAMPLE RESPONSE :
{ "statusCode":"S502", "statusDetail":"Update circular geofence success", "responseData": { "applicationId":"zfpqb6e9", "geofenceId":"0ynnznwh", "geofenceName":"cgf1", "radius":23.345, "lat":7.099081164, "lng":79.9141994 } }
5.3. Circular Geofence View Service
- DESCRIPTION : To view circular geofences
- URL:https://ideabiz.lk/apicall/dapgeofence/v1.0/circular/get
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required geofenceId Unique id for the circular geofence string required - SUCCESS RESPONSE:
Status Code S504 StatusDetail Get Circular Geofence Sucess responseData - applicationId
- geofenceId
- geofenceName
- radius
- lat
- lng
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E504 <parameter> not found or empty in the request E540 No circular geofence found for application id : <applicationId> geofence id : <geofenceId> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "geofenceId":"0ynnznwh" }
-
SAMPLE RESPONSE :
{ "statusCode":"S504", "statusDetail":"Get Circular Geofence Success", "responseData": { "applicationId":"zfpqb6e9", "geofenceId":"0ynnznwh", "geofenceName":"cgf1", "radius":23.345, "lat":7.099081164, "lng":79.9141994 } }
5.4. Circular Geofence Remove Service
- DESCRIPTION : To remove circular geofences.
- URL:https://ideabiz.lk/apicall/dapgeofence/v1.0/circular/remove
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required geofenceId Unique id for the circular geofence string required - SUCCESS RESPONSE:
Status Code S503 StatusDetail Remove Circular Geofence Success responseData - applicationId
- geofenceId
- geofenceName
- radius
- lat
- lng
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E503 <parameter> not found or empty in the request E540 No circular geofence found for application id : <applicationId> geofence id : <geofenceId> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "geofenceId":"0ynnznwh" }
-
SAMPLE RESPONSE :
{ "statusCode":"S503", "statusDetail":"Remove Circular Geofence Success", "responseData": { "applicationId":"zfpqb6e9", "geofenceId":"0ynnznwh", "geofenceName":"cgf1", "radius":23.345, "lat":7.099081164, "lng":79.9141994 } }
5.5. Polygon Geofence Create Service
- DESCRIPTION : To remove circular geofences.
- URL:https://ideabiz.lk/apicall/dapgeofence/v1.0/polygon/create
- METHOD: POST
- Headers :
Key Value accept authorization Content-Type application/json Bearer [access token] application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required geofenceId Unique id for the circular geofence string required pointArray Polygon point array ( json string ) string required - SUCCESS RESPONSE:
Status Code S510 StatusDetail Polygon geofence create success responseData - applicationId
- geofenceId
- geofenceName
- polygon
- Array containing all points in polygon
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E312 Error in format : <lat> lng : <lng> E510 <parameter> not found or empty in the request E535 Error in pointArray format <pointArray> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "geofenceName":"poly1", "pointArray":"[[6.908377, 79.869157],[6.904119, 79.880633],[6.897827, 79.875394],[6.901664, 79.864887],[6.908377, 79.869157]]" }
-
SAMPLE RESPONSE :
{ "statusCode":"S510", "statusDetail":"Add Polygon Geofence Success", "responseData": { "applicationId":"zfpqb6e9", "geofenceId":"1s05anjl", "geofenceName":"poly1", "polygon": [ [ [ 79.869157, 6.908377 ], ..., [ 79.869157, 6.908377 ] ] ] } }
5.6. Polygon Geofence Update Service
- DESCRIPTION : To update polygon geofences
- URL:https://ideabiz.lk/apicall/dapgeofence/v1.0/polygon/update
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required geofenceId Unique id for the circular geofence string required geofenceName Name to identify the geofence string required pointArray Polygon point array ( json string ) string required - SUCCESS RESPONSE:
Status Code S511 StatusDetail Polygon geofence update success responseData - applicationId
- geofenceId
- geofenceName
- polygon
- Array containing all points in polygon
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId>
E312 Error in format : <lat> lng : <lng> E511 <parameter> not found or empty in the request E535 Error in pointArray format <pointArray> E540 No polygon geofence found for application id : <applicationId> geofence id : <geofenceId> E550 Both geofenceName and pointArray are not in the request -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "geofenceId":"1s05anjl", "geofenceName":"poly-updated", "pointArray":"[[6.908377, 79.869157],[6.904119, 79.880633],[6.897827, 79.875394],[6.901664, 79.864887],[6.908377, 79.869157]]" }
-
SAMPLE RESPONSE :
{ "statusCode":"S511", "statusDetail":"Update Polygon Geofence Success", "responseData": { "applicationId":"zfpqb6e9", "geofenceId":"1s05anjl", "geofenceName":"poly-updated" } }
5.7. Polygon Geofence View Service
- DESCRIPTION : To view polygon geofences
- URL:https://ideabiz.lk/apicall/dapgeofence/v1.0/polygon/get
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required geofenceId Unique id for the circular geofence string optional - SUCCESS RESPONSE:
Status Code S512 StatusDetail Polygon geofence get success responseData - applicationId
- geofenceId
- geofenceName
- polygon
- Array containing all points in polygon
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E512 <parameter> not found or empty in the request E540 No polygon geofence found for application id : <applicationId> geofence id : <geofenceId> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "geofenceId":"1s05anjl", }
-
SAMPLE RESPONSE :
{ "statusCode":"S512", "statusDetail":"Get Polygon Geofence Success", "responseData": { "applicationId":"zfpqb6e9", "geofenceId":"1s05anjl", "geofenceName":"poly-updated" "polygon":[ [ [ 79.869157, 6.908377 ], ... [ 79.869157, 6.908377 ] ] ] ] } }
5.8. Polygon Geofence Remove Service
- DESCRIPTION : To remove polygon geofences
- URL:https://ideabiz.lk/apicall/dapgeofence/v1.0/polygon/remove
- METHOD: POST
- Headers :
Key Value accept application/json authorization Bearer [access token] Content-Type application/json - DATA PARAMETERS (POST json parameters) :
Parameter Name Description Type Required / Optional applicationId Application unique id string required geofenceId Unique id for the circular geofence string required - SUCCESS RESPONSE:
Status Code S513 StatusDetail Remove Polygon Geofence success responseData - applicationId
- geofenceId
- geofenceName
- polygon
- Array containing all points in polygon
- ERROR RESPONSE:
Error code Error message E130 No application found for application id : <applicationId> E513 <parameter> not found or empty in the request E540 No polygon geofence found for application id : <applicationId> geofence id : <geofenceId> -
SAMPLE HEADER :
accept:application/json authorization:Bearer 3efd841a652a45d978684ab9f357e95 Content-Type:application/json
-
SAMPLE REQUEST :
{ "applicationId":"zfpqb6e9", "geofenceId":"1s05anjl", }
-
SAMPLE RESPONSE :
{ "statusCode":"S513", "statusDetail":"Remove Polygon Geofence Success", "responseData": { "applicationId":"zfpqb6e9", "geofenceId":"1s05anjl", "geofenceName":"poly-updated", "polygon":[ [ [ 79.869157, 6.908377 ], ... [ 79.869157, 6.908377 ] ] ] ] } }